<?php

class Alimentos extends CI_Controller {
	
	public function __construct() {
		parent::__construct();
	}
	
	public function index(){
		$this->load->model('Nutritionist','n');
		$this->n->logged();

				
		$data['id_nutritionist'] = $this->session->userdata('id_nutritionist');
		$data['title'] = 'Alimentos';
		$data['email_n'] = $this->session->userdata('email_n');

		$this->load->model('Food','f');
		$data['foods'] = $this->f->get_food_measure_all();
		
		$this->load->view('area_admin/alimentos_view', $data);
		
	}
	
	public function novo_alimento(){
		$this->load->model('Nutritionist','n');
		$this->n->logged();

		$data['id_nutritionist'] = $this->session->userdata('id_nutritionist');
		$data['title'] = 'Novo Alimento';
		$data['email_n'] = $this->session->userdata('email_n');
		
		$this->load->model('Measure','m');
		$data['measures'] = $this->m->get_measure_all();
		
		$this->load->view('area_admin/alimento_novo_view', $data);
	}
	
	//Area de controle de Alimento
	public function alimento_home($id){
		$this->load->model('Nutritionist','n');
		$this->n->logged();

		$this->load->model('Food','f');
		$data['email_n']= $this->session->userdata('email_n');
		$data['food']= $this->f->get_food_measure_by_id($id);
		$this->load->model('Measure','m');
		$data['measures'] = $this->m->get_measure_all();

		$this->load->view('area_admin/alimento_home_view', $data);
	}
}

/* End of file alimentos.php */
/* Location: ./application/controllers/area_admin/alimentos.php */